//////////////////////////////////////////// Structure declaration ///////////////////////////////////////////// #define MAX_PB_BLENDED_WEIGHTS 2 typedef struct _tagVertexB2 { D3DVECTOR Position ; FLOAT Weights[MAX_PB_BLENDED_WEIGHTS] ; BYTE Indices[4] ; // you can choose to make it 2 shorts. D3DVECTOR Normal ; float tu, tv ; } VertexB2 ; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////// Globals ///////////////////////////// LPDIRECT3DVERTEXBUFFER8 g_pbVB ; // vertex buffer which holds our plane vertex data LPDIRECT3DINDEXBUFFER8 g_pbIB ; // index buffer which holds our plane face data LPDIRECT3DTEXTURE8 g_pbTexture ; // texture #define MAX_V_SHADERS 5 #define BASIC_VS 0 // VS for transforming vertex #define BASIC_VS_WITHLIGHT 1 // VS for transforming and lighting #define BLEND_ONLY 2 // VS for blending the vertex. #define NON_BLEND_ONLY 3 // VS for no-blending #define BLEND_WITH_LIGHT 4 // VS for blending with lighting. // shader handles DWORD g_pbVS[MAX_V_SHADERS] ; // our shader handle. Basic one. DWORD g_dwpbNumVertices , // Number of vertices in the plane g_dwpbNumIndices ; // Number of faces in the plane D3DMATRIX g_rotMatPlane1 , // rotation matrix for the left half of the plane g_rotMatPlane2 ; // rotation matrix for the right half of the plane ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // macros #define MAX_PLANE_TESS_LEVEL_HORZ 5 // horizontal tesselation level #define MAX_PLANE_TESS_LEVEL_VERT 3 // vertical tesselation level #define PLANE_WIDTH 40 // physical width of the plane #define PLANE_HEIGHT 30 // physical height of the plane